﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CourseContent.aspx.cs"
	Inherits="CourseManager.View.Contents.Admin.CourseContent" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>课程管理</title>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<ext:ResourceManager runat="server" />
		<ext:Store runat="server" ID="CourseStore">
			<Reader>
				<ext:JsonReader IDProperty="courseId,tId">
					<Fields>
						<ext:RecordField Name="courseId" />
						<ext:RecordField Name="tId" />
						<ext:RecordField Name="courseName" />
						<ext:RecordField Name="teacherName" />
						<ext:RecordField Name="credit" />
						<ext:RecordField Name="time" />
						<ext:RecordField Name="campus" />
						<ext:RecordField Name="place" />
						<ext:RecordField Name="dept" />
						<ext:RecordField Name="capacity" />
					</Fields>
				</ext:JsonReader>
			</Reader>
		</ext:Store>
		<ext:Viewport runat="server" Layout="Fit">
			<Items>
				<ext:Panel ID="EpnMain" runat="server" Header="false" Border="false" Layout="border">
					<TopBar>
						<ext:Toolbar runat="server">
							<Items>
								<ext:Button runat="server" Icon="Add" ID="btnOpenSearch" ToolTip="添加" Text="添加" Visible="true">
									<Listeners>
										<Click Handler="#{AddWindow}.show();" />
									</Listeners>
								</ext:Button>
								<ext:ToolbarSpacer Width="480" />
								<ext:TextField runat="server" ID="txtKeyword" Width="150" MaxLength="20" EmptyText="搜索关键字" />
								<ext:Button runat="server" ID="btnSearch" Text="查询" Icon="YcZoomClassic" Width="55">
									<DirectEvents>
										<Click OnEvent="BtnSearchClick">
											<EventMask ShowMask="true" Msg="正在查询，请稍候..."  />
										</Click>
									</DirectEvents>
								</ext:Button>
							</Items>
						</ext:Toolbar>
					</TopBar>
					<Items>
						<ext:GridPanel runat="server" ID="pnlUser" Header="true" Border="false" Title="课程管理"
							StoreID="CourseStore" StripeRows="true" EnableColumnMove="false" EnableColumnHide="false"
							EnableHdMenu="false" Region="Center">
							<ColumnModel>
								<Columns>
									<ext:RowNumbererColumn Width="40" />
									<ext:Column Header="课程号" Width="80" DataIndex="courseId" Sortable="false" Align="Center" />
									<ext:Column Header="教师号" Width="50" DataIndex="tId" Align="Center" />
									<ext:Column Header="课程名" Width="120" DataIndex="courseName" Align="Center" />
									<ext:Column Header="学分" Width="40" DataIndex="credit" Align="Center" />
									<ext:Column Header="教师名" Width="70" DataIndex="teacherName" Align="Center" />
									<ext:Column Header="时间" Width="80" DataIndex="time" Align="Center" />
									<ext:Column Header="院系" Width="50" DataIndex="dept" Align="Center" />
									<ext:Column Header="校区" Width="40" DataIndex="campus" Align="Center" />
									<ext:Column Header="地点" Width="60" DataIndex="place" Align="Center" />
									<ext:Column Header="容量" Width="40" DataIndex="capacity" Align="Center" />
									<ext:CommandColumn Width="60" Header="操作">
										<Commands>
											<ext:GridCommand Icon="YcEdit" CommandName="Update" ToolTip-Text="修改" />
											<ext:GridCommand Icon="YcDelete" CommandName="Delete" ToolTip-Title="删除" />
										</Commands>
									</ext:CommandColumn>
								</Columns>
							</ColumnModel>
							<SelectionModel>
								<ext:RowSelectionModel ID="ExtendRowSelectionModel1" runat="server" SingleSelect="true" />
							</SelectionModel>
							<Listeners>
								<Command Handler="DoCommand(command,record.data.id, record.data.name, record.data.accountType, record.data.sex, record.data.dept);" />
							</Listeners>
							<LoadMask ShowMask="true" Msg="正在加载，请稍候..." />
							<BottomBar>
								<ext:PagingToolbar ID="pagingBar" runat="server" PageSize="15" DisplayInfo="true"
									RefreshText="刷新" StoreID="CourseStore">
									<Items>
										<ext:ToolbarSpacer runat="server" Width="10" />
										<ext:Label runat="server" Text="每页显示:" />
										<ext:ToolbarSpacer runat="server" Width="10" />
										<ext:ComboBox runat="server" Width="80" Editable="false">
											<Items>
												<ext:ListItem Text="10" />
												<ext:ListItem Text="15" />
												<ext:ListItem Text="20" />
												<ext:ListItem Text="25" />
											</Items>
											<SelectedItem Value="15" />
											<Listeners>
												<Select Handler="#{pagingBar}.pageSize = parseInt(this.getValue()); #{pagingBar}.doLoad();" />
											</Listeners>
										</ext:ComboBox>
										<ext:ToolbarSpacer runat="server" Width="10" />
										<ext:Label runat="server" Text="条记录" />
									</Items>
								</ext:PagingToolbar>
							</BottomBar>
						</ext:GridPanel>
					</Items>
				</ext:Panel>
			</Items>
		</ext:Viewport>
		<ext:Window runat="server" ID="AddWindow" Width="300" Height="300" Title="添加课程" Icon="YcGroupMembers"
			Layout="Fit" Hidden="true" Frame="true" Resizable="false" Modal="true" BodyStyle="background-color:transparent;">
			<Items>
				<ext:FormPanel ID="FormPanel1" runat="server" Border="false" Padding="5" AutoScroll="true"
					LabelAlign="Left" LabelWidth="80" Frame="true">
					<Items>
						<ext:TextField runat="server" ID="txtAddId" FieldLabel="课程号" Width="140" MaxLength="100"
							AllowBlank="false" InvalidText="*" Margins="side" ReadOnly="false" BlankText="请输入用户名" />
						<ext:ComboBox runat="server" ID="txtAddT_Id" FieldLabel="" Width="60" Editable="false"
							SelectOnFocus="true" ClearButton="true" BlankText="请选择校区">
							<Items>
								<ext:ListItem Text="延长" Value="延长" />
								<ext:ListItem Text="宝山" Value="宝山" />
								<ext:ListItem Text="嘉定" Value="嘉定" />
							</Items>
						</ext:ComboBox>
						<ext:TextField runat="server" ID="txtAddName" FieldLabel="课程名" Width="140" MaxLength="10" />
						<ext:TextField runat="server" ID="txtAddTeacherId" FieldLabel="教师号" Width="140" MaxLength="10" />
						<ext:ComboBox runat="server" ID="txtAddCredit" FieldLabel="学分" Width="60" Editable="true"
							SelectOnFocus="true" ClearButton="true" BlankText="请选择学分">
							<Items>
								<ext:ListItem Text="0" Value="0" />
								<ext:ListItem Text="0.5" Value="0.5" />
								<ext:ListItem Text="1" Value="1" />
								<ext:ListItem Text="1.5" Value="1.5" />
								<ext:ListItem Text="2" Value="2" />
								<ext:ListItem Text="2.5" Value="2.5" />
								<ext:ListItem Text="3" Value="3" />
								<ext:ListItem Text="3.5" Value="3.5" />
								<ext:ListItem Text="4" Value="4" />
								<ext:ListItem Text="4.5" Value="4.5" />
								<ext:ListItem Text="5" Value="5" />
								<ext:ListItem Text="5.5" Value="5.5" />
								<ext:ListItem Text="6" Value="6" />
							</Items>
						</ext:ComboBox>
						<ext:ComboBox runat="server" ID="txtAddCampus" FieldLabel="校区" Width="60" Editable="false"
							SelectOnFocus="true" ClearButton="true" BlankText="请选择校区">
							<Items>
								<ext:ListItem Text="延长" Value="延长" />
								<ext:ListItem Text="宝山" Value="宝山" />
								<ext:ListItem Text="嘉定" Value="嘉定" />
							</Items>
						</ext:ComboBox>
						<ext:TextField runat="server" ID="txtAddDept" FieldLabel="院系" Width="140" MaxLength="20" />
					</Items>
					<Buttons>
						<ext:Button runat="server" Text="确定" ID="BtnAddOk" Icon="accept">
							<Listeners>
								<Click Handler="if (!#{txtAddId}.validate()) { return false;}" />
							</Listeners>
							<DirectEvents>
								<Click OnEvent="BtnAddOkClick">
									<EventMask ShowMask="true" Msg="正在添加,请稍后..." />
								</Click>
							</DirectEvents>
						</ext:Button>
						<ext:Button runat="server" Text="取消" Icon="YcDeclineTask">
							<Listeners>
								<Click Handler="#{AddWindow}.hide();" />
							</Listeners>
						</ext:Button>
					</Buttons>
				</ext:FormPanel>
			</Items>
		</ext:Window>
		<ext:Window runat="server" ID="UpdateWindow" Width="300" Height="225" Title="修改学生信息"
			Icon="YcGroupMembers" Layout="Fit" Hidden="true" Frame="true" Resizable="false"
			Modal="true" BodyStyle="background-color:transparent;">
			<Items>
				<ext:FormPanel ID="FormPanel2" runat="server" Border="false" Padding="5" AutoScroll="true"
					LabelAlign="Left" LabelWidth="80" Frame="true">
					<Items>
						<ext:TextField runat="server" ID="txtUpdateId" FieldLabel="学号" Width="140" MaxLength="100"
							AllowBlank="false" Enabled="false" InvalidText="*" Margins="side" ReadOnly="false"
							BlankText="请输入用户名" />
						<ext:TextField runat="server" ID="txtUpdateName" FieldLabel="姓名" Width="140" MaxLength="10" />
						<ext:ComboBox runat="server" ID="cbUpdateSex" FieldLabel="性别" Width="50" Editable="false"
							SelectOnFocus="true" ClearButton="true" BlankText="请选择性别">
							<Items>
								<ext:ListItem Text="男" Value="男" />
								<ext:ListItem Text="女" Value="女" />
							</Items>
						</ext:ComboBox>
						<ext:ComboBox runat="server" ID="cbUpdateGrade" FieldLabel="年级" Width="70" Editable="false"
							SelectOnFocus="true" ClearButton="true" BlankText="请选择年级">
							<Items>
								<ext:ListItem Text="2008" Value="2008" />
								<ext:ListItem Text="2009" Value="2009" />
								<ext:ListItem Text="2010" Value="2010" />
								<ext:ListItem Text="2011" Value="2011" />
								<ext:ListItem Text="2012" Value="2012" />
								<ext:ListItem Text="2013" Value="2013" />
								<ext:ListItem Text="2014" Value="2014" />
								<ext:ListItem Text="2015" Value="2015" />
							</Items>
						</ext:ComboBox>
						<ext:TextField runat="server" ID="txtUpdateDept" FieldLabel="院系" Width="140" MaxLength="20" />
					</Items>
					<Buttons>
						<ext:Button ID="Button1" runat="server" Text="确定" Icon="accept">
							<Listeners>
								<Click Handler="if (!#{txtUpdateId}.validate()) { return false;}" />
							</Listeners>
							<DirectEvents>
								<Click OnEvent="BtnUpdateOkClick">
									<EventMask ShowMask="true" Msg="正在更新,请稍后..." />
								</Click>
							</DirectEvents>
						</ext:Button>
						<ext:Button ID="Button2" runat="server" Text="取消" Icon="YcDeclineTask">
							<Listeners>
								<Click Handler="#{UpdateWindow}.hide();" />
							</Listeners>
						</ext:Button>
					</Buttons>
				</ext:FormPanel>
			</Items>
		</ext:Window>
	</div>
	</form>
</body>
</html>
